﻿using Bricks.Component.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Bricks.Business.Models.Account
{
    [Description("机构")]
    public class OrgInfo : EntityBase<Guid>
    {
        public OrgInfo()
        {
            ID = GuidHelper.NewGuid();
        }

        [Display(Name = "机构名称")]
        [StringLength(32)]
        public string OrgName { get; set; }

        [Display(Name = "机构编码")]
        [StringLength(64)]
        public string OrgCode { get; set; }

        [Display(Name = "邮箱")]
        [StringLength(1024)]
        public string Email { get; set; }

        [Display(Name = "联系电话")]
        [StringLength(256)]
        public string Contactphone { get; set; }

        [Display(Name = "排序")]
        public int OrderNo { get; set; }

        [Display(Name = "上级")]
        public Guid? PID { get; set; }

        [Display(Name = "机构类型")]
        public OrgType OrgType
        {
            get
            {
                return (OrgType)OrgTypeNum;
            }
            set
            {
                OrgTypeNum = (int)value;
            }
        }

        [Display(Name = "机构类型")]
        public int OrgTypeNum { get; set; }

        [Display(Name = "描述")]
        [StringLength(1024)]
        public string Description { get; set; }

        #region Collection
        //public virtual ICollection<UserInfo> Users { get; set; }
        #endregion
    }
}
